def greet_user(username):
    """显示简单的问候语"""
    print("Hello! " + username.title() + "!")

greet_user('wangxu')

def display_message():
    print("你将在本章学习的是函数。")
    
display_message()

def favorite_book(book):
    print("My favorite_book is " + book)

favorite_book("Alice in Wonderland")


def describe_pet(animal_type, pet_name):
    """显示宠物的信息"""
    print("\nI have a " + animal_type + ".")
    print("My " + animal_type + "'s name is " + pet_name.title() + ".")

describe_pet('hamster', 'harry')
describe_pet('dog', 'willie')
describe_pet(animal_type='fish', pet_name='gold')

print("\n-----------给形参指定默认值-----------")

def describe_pet1(pet_name, animal_type='dog'):
    print("\nI have a " + animal_type + ".")
    print("My " + animal_type + "'s name is " + pet_name.title() + ".")

describe_pet1('willie')
describe_pet1(animal_type='fish', pet_name='gold_better')
# describe_pet1()

print("-----make_shirt-------")
def make_shirt(rule='middle', style='I love Python'):
    print("\nThe rule of shirt is " + str(rule) + '.')
    print("The style of shirt is " + style + '.')

make_shirt('small', '好好学习')
make_shirt(style='python student', rule='middle')
make_shirt('large')
make_shirt('middle')
make_shirt(style='C')

# describe_city
def describe_city(city, country='China'):
    print("\n" + city + " is in " + country + '.')

describe_city('广州', '中国')
describe_city('Reykjavik', 'Iceland')
